home *** CD-ROM | disk | FTP | other *** search
- /*
- File: BareBones.h
-
- Contains: Common header file included by all source files
-
- Written by: Chris White, Developer Technical Support
-
- Copyright: © 1996 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- 1/22/96 CW First release
-
- */
-
-
-
- #ifndef __BAREBONES__
- #define __BAREBONES__
-
-
-
- #ifndef __DIALOGS__
- #include <Dialogs.h>
- #endif
-
- #ifndef __THREADS__
- #include <Threads.h>
- #endif
-
-
-
-
- #define DEBUGGING 1 // Anything that shouldn't normally occur
- #define WARNINGS 0 // Something that can occur, but you might like to know about
-
-
-
-
- enum
- {
- // Generall application stuff
-
- kCreatorCode = 'prgr', // Progress Bars
- kSleepTime = 60L
-
- };
-
-
-
- enum
- {
- // Menu ID numbers
-
- kMenuBarID = 1000,
- kAppleMenu = 1000,
- kFileMenu = 1001,
- kProgressBarsMenu
- };
-
-
-
- enum
- {
- // Apple menu commands
-
- cAbout = 1
- };
-
-
-
- enum
- {
- // File menu commands
-
- cQuit = 1
- };
-
-
-
- enum
- {
- // ProgressBars menu commands
-
- cToggleThreads = 1,
- cSeperator1,
- cStandard,
- cBarberPole
- };
-
-
-
-
-
-
- enum
- {
- // General Windows and Dialogs
-
- kDisplayWindow = 1000,
- kAboutDialog,
- kErrorDialog
- };
-
-
-
- enum
- {
- // Progress Dialog
-
- kProgressDialogID = 1000,
- kCancelItemID = 1,
- kUserItemID,
- kStaticTextItemID
- };
-
-
-
- enum
- {
- // Strings
-
- kErrorStrings = 1000,
- kMiscStrings
- };
-
-
-
- enum
- {
- // Error String Index
-
- kNeedSystem7 = 1,
- kGenericErrorStr
- };
-
-
-
- enum
- {
- // Misc String Index
-
- kProgressStr = 1
-
- };
-
-
-
- enum
- {
- // Internal flags
-
- kBarberPoleFinished = -1
- };
-
-
-
- enum
- {
- // Thread readability
-
- kDefaultStackSpace = 0,
- kNoCreationOptions = 0
- };
-
-
-
- // Non-Threaded typedefs
-
- // Routine pointer to the operation being carried out. It
- // must call the UpdateOperation routine periodically.
- typedef Boolean (*tOperation) ( void* refCon, DialogRef theDialog );
-
-
-
-
- // Threaded typedefs
-
- struct ThreadedOperationRec
- {
- int usageCount;
- void* refCon;
- Boolean bCancelled;
- Boolean bBarberPole;
- int maxAmount;
- int doneAmount;
- int drawnAmount;
- Str255 theText;
- };
-
- typedef struct ThreadedOperationRec tThreadedOperationRec, *tThreadedOperationPtr;
-
-
- // Routine pointer to the operation being carried out. It doesn't have to do
- // anything special except yield to other threads.
- typedef pascal SInt32 (*tThreadedOperation) ( tThreadedOperationPtr refCon );
-
-
-
- // Global Variable Definitions. This allows me to include this file
- // in all sources with the extern keyword used in all instances except
- // the main source file.
-
- #ifdef __MAIN__
- #define global
- #else
- #define global extern
- #endif
-
-
-
- global Boolean gQuit; // quit program flag
- global SInt32 gSleepTime;
- global Boolean gHasThreadManager; // Do we have the Thread Manager?
-
- global UserItemUPP gOutlineUserItemUPP;
-
-
-
-
-
- #endif // __BAREBONES__
-